#ifndef __drv_l1_DAC_H__
#define __drv_l1_DAC_H__

#ifdef __cplusplus
extern "C"
{
#endif
#include "project.h"

#define DRV_l1_DAC_ON_OFF		0		// avoid POP noise

extern void		dac_init(void);
extern void		dac_enable_set(BOOLEAN status);
extern void		dac_disable(void);
extern void		dac_audop_speaker_en(BOOLEAN status);

extern void		dac_cha_data_put(INT16S *data, INT32U len, INT8S *notify);
extern void		dac_chb_data_put(INT16S *data, INT32U len, INT8S *notify);
extern INT32S	dac_cha_data_dma_put(INT16S *data, INT32U len, INT8S *notify);
extern INT32S	dac_chb_data_dma_put(INT16S *data, INT32U len, INT8S *notify);
extern void		dac_audop_enable_set(void);
extern void		dac_audop_vol_set(int vol);
extern void		dac_fifo_level_set(INT8U cha_level, INT8U chb_level);
extern void		dac_sample_rate_set(INT32U hz);
extern void		dac_mono_set(void);
extern void		dac_stereo_set(void);
extern void		dac_stereo_indi_buffer_set(void);
extern void		dac_timer_stop(void);
extern void		dac_pga_set(INT8U gain);
extern void		dac_vref_set(BOOLEAN status);
extern INT8U	dac_pga_get(void);
extern void		drv_l1_dac_init(void);

#if _OPERATING_SYSTEM == _OS_UCOS2
#include "os.h"
extern INT32S	dac_cha_dbf_put(INT16S *data, INT32U len, OS_EVENT *os_q);
extern INT32S	dac_cha_dbf_set(INT16S *data, INT32U len);
extern void		dac_dbf_free(void);
extern INT32S	dac_dbf_status_get(void);
extern INT32S	dac_dma_status_get(void);
#endif

#ifdef __cplusplus
}

#endif
#endif // __drv_l1_DAC_H__
